package com.liveneo.adapter.mobile.service.impl;

import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.liveneo.adapter.base.entity.PrpmUploadLossItemImg;
import com.liveneo.adapter.base.mapper.PrpmUploadLossItemImgMapper;
import com.liveneo.adapter.base.support.PageParam;
import com.liveneo.adapter.mobile.service.PrpmUploadLossItemImgService;

@Service
public  class PrpmUploadLossItemimgServiceImpl implements PrpmUploadLossItemImgService {
    @Autowired
    private PrpmUploadLossItemImgMapper lossItemimgMapper;

    @Override
    public List<PrpmUploadLossItemImg> selectByLossItemCypId(String lossItemCypId) {
        return lossItemimgMapper.selectByLossItemCypId(lossItemCypId);
    }

	@Override
	public List<PrpmUploadLossItemImg> selectByLossItemCypIdPage(String lossItemCypId,String pageNum) {
		PageParam pageParam = new PageParam();
		pageParam.setPageNum(pageNum);
		pageParam.setPageSize(10);
		// 判断是否含有排序的字符串
        if (StringUtils.isNotBlank(pageParam.getOrderBy())) {
            PageHelper.orderBy(pageParam.getOrderBy());
        }
		return lossItemimgMapper.selectByLossItemCypId(lossItemCypId);
	}
    @Override
    public int saveUploadLossItemimg(PrpmUploadLossItemImg record) {
        return lossItemimgMapper.insert(record);
    }
    
    public int saveUploadList(List<PrpmUploadLossItemImg> listRecord) {
        return lossItemimgMapper.insertBatch(listRecord);
    }

    @Override
    public List<PrpmUploadLossItemImg> selectByCheckUuid(String checkUuid) {
        return lossItemimgMapper.selectByCheckUuid(checkUuid);
    }

    @Override
    public List<PrpmUploadLossItemImg> selectByCheckUuidAndMobile(String checkUuid, String mobile) {
        return lossItemimgMapper.selectByCheckUuidAndMobile(checkUuid, mobile);
    }

    @Override
    public int updateByPrimaryKey(PrpmUploadLossItemImg record) {
        return lossItemimgMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int insert(PrpmUploadLossItemImg record) {
        return lossItemimgMapper.insert(record);
    }

    @Override
    public int deleteByIDList(List<String> idList) {
        return lossItemimgMapper.deleteByIDList(idList);
    }

    @Override
    public int delete(String ID) {
        return lossItemimgMapper.delete(ID);
    }

}
